package 线程池.作业;

import java.util.concurrent.atomic.AtomicInteger;

public class 使用自增自减等方法 {
    public static void main(String[] args) {
        AtomicInteger air = new AtomicInteger();
        System.out.println(air.get());
        System.out.println(air.addAndGet(1));//1
        System.out.println(air.getAndAdd(3));//1
        System.out.println(air.getAndIncrement());//4
        System.out.println(air.incrementAndGet());//6
        System.out.println(air.getAndDecrement());//6
        System.out.println(air.decrementAndGet());//4
        System.out.println(air.getAndSet(33));//33

    }
}
